recursive tree method for solving recurrences